/*
 * Copyright (C) Jochen Hiller, Bernd Kolb.
 * 
 * Licensed under Apache 2.0.
 * See http://www.apache.org/licenses/LICENSE-2.0
 */
package demo.geolocation;

import java.util.List;

import android.app.Activity;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationManager;
import android.os.Bundle;

public class GeoLocationActivity1 extends Activity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		LocationManager locManager = (LocationManager) getSystemService(LOCATION_SERVICE);
		List<String> providers = locManager.getAllProviders();

		Criteria criteria = new Criteria();
		criteria.setPowerRequirement(Criteria.POWER_LOW);
		String bestProvider = locManager.getBestProvider(criteria, true);
		Location location = locManager.getLastKnownLocation(bestProvider);

		// Start updates (doc recommends delay >= 60000 ms)
		// 1 means notify when location change more than 1 meter
		// locManager.requestLocationUpdates(bestLocationProvider, 15000, 1,
		// aTracker);
		// Stop updates to save power while app paused
		// locManager.removeUpdates(aTracker);

	}

}